<?php 
$id=intval($_GET['id']);
if(!$id){
  echo "<script> window.location.href='home.php?lsact=orderlist'</script>";
  exit;
}
$db->query("select * from ld_order where id=".$id."",2);
$rs=$db->rs;
if($_userid!=$rs['bid']){
  echo "<script> window.location.href='home.php?lsact=orderlist'</script>";
  exit;
}
if($rs['status']==1){
      $status='<font color="red">未发货</font>';
    }elseif($rs['status']==2){
      $status='已发货';
    }else{
      $status='已签收';
    }
?>

<link rel="stylesheet" href="/images/datalist.css" type="text/css"></HEAD>
<?php  require("topbut.php") ?>
<div class="panel panel-inverse">
    <div class="panel-heading">
      <h4 class="panel-title">订单查看</h4>
    </div>
    <div class="panel-body">
        <form name="form1" method="post" action="">
            <div class="table-responsive">
                <table class="table table-bordered table-striped acc-table">
                    <TR>
                      <TD>订购会员:</TD>
                      <TD><?php  echo $rs["bname"]?></TD>
                    </TR>
                    <TR>
                      <TD>订单时间:</TD>
                      <TD><?php  echo date("Y-m-d",$rs["btime"])?></TD>
                    </TR>
                    <TR>
                      <TD>状态:</TD>
                      <TD><?php  echo $status;?></TD>
                    </TR>
                    <TR>
                      <TD>产品列表</TD>
                      <td>
                       <table class="table table-bordered">
                          <tbody>
                            <tr>
                              <td align="center">产品编号</td>
                              <td align="center">产品图</td>
                              <td align="center">产品名</td>
                              <td align="center">单价</td>
                            </tr>
                            <?php 
                            $db->query("select * from ld_product where id=".$rs['bpid'],2);
                            $req=$db->rs;
                            ?>
                            <tr>
                              <td align="center"><?php  echo $req["id"]?></td>
                              <td align="center"><a href="<?php  echo $req["proimg"]?>" target="_blank"><img src="<?php  echo RemoveXSS($req["proimg"])?>" height="60" border="0" /></a></td>
                              <td align="center"><?php  echo $req["productname"]?></td>
                              <td align="center"><?php  echo $req["price"];?></td>
                            </tr>
                            </tbody>
                          </table>

                      </td>
                    </TR>
                    <TR>
                      <TD>订购数量:</TD>
                      <TD> <?php  echo $rs["bnum"]?></TD>
                    </TR>
                    <TR>
                      <TD>总价格:</TD>
                      <TD>
                        <?php 
                          echo $rs['bnum']*$rs['bprice'].'积分';
                        ?>
                      </TD>
                    </TR>
                    <TR>
                      <TD>收货人:</TD>
                      <TD> <?php  echo $rs["bsname"]?></TD>
                    </TR>
                    <TR>
                      <TD>联系电话:</TD>
                      <TD> <?php  echo $rs["bphone"]?></TD>
                    </TR>
                    <TR>
                      <TD>收货地址:</TD>
                      <TD> <?php  echo $rs["baddress"]?></TD>
                    </TR>
                    <TR>
                    <TR>
                      <TD>收货备注:</TD>
                      <TD> <?php  echo $rs["sbeizhu"]?></TD>
                    </TR>
                    <TR>
                    <?php 
                    if($rs['status']>=2){
                      ?>
                        <TR>
                           <TD>物流方式:</TD>
                           <TD> <?php  echo $rs["bftype"]?></TD>
                        </TR>
                        <TR>
                          <TD>物流编号:</TD>
                          <TD> <?php  echo $rs["bfbianhao"]?></TD>
                        </TR>
                        <TR>
                          <TD>发货时间:</TD>
                          <TD> <?php  echo $rs["bftime"]?></TD>
                        </TR>
                    <TR>
                      <?php 
                    }
                    ?>
                      <TD colspan="2" align="right" valign="middle">
                        <INPUT class="btn btn-sm btn-warning" type=button  id="but" value="返回" name="but" onClick="history.back();">
                        </TD>
                      </TR>
                </table>
            </div>
        </form>
    </div>
</div>
